package com.samuel.event;


import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @date:2017/11/22
 * @time: 11:33
 * @author:zhaoyang
 * @desc: 监听 DemoEvent
 **/
@Component
public class DemoListener implements ApplicationListener<DemoEvent> {


    @Override
    public void onApplicationEvent(DemoEvent demoEvent) {
        System.out.println("DemoListener 接收到了消息："+demoEvent.getMsg());

        // todo somthing  after listened this msg
        System.out.println("听到这个消息，我需要去告诉村长，防着他");
    }
}
